import Vue from 'vue'
import Router from 'vue-router'
import Login from '@v/Login.vue'
import Fault from '@v/404.vue'
import Index from '@v/Index.vue'
  import Mydata from '@v/dashboardmg/Mydata.vue'
  import Mydevice from '@v/dashboardmg/Mydevice.vue'
  import Problem from '@v/dashboardmg/Problem.vue'
   import Notnotified from '@v/dashboardmg/subproblem/notnotified.vue'
   import Notified from '@v/dashboardmg/subproblem/notified.vue'
   //import Starmail from '@v/dashboardmg/submymailbox/Starmail.vue'
  import Exceptionreport from '@v/datamg/Exceptionreport.vue'
  import Picturepreview from '@v/datamg/Picturepreview.vue'
    import Picturelist from '@v/datamg/subdatamg/Picturelist.vue'
    import Preview from '@v/datamg/subdatamg/Preview.vue'
  import Runningreport from '@v/datamg/Runningreport.vue'
  import Sysreport from '@v/datamg/Sysreport.vue'
  import Userreport from '@v/datamg/Userreport.vue'
  import Videopreview from '@v/datamg/Videopreview.vue'
    import Videolist from '@v/datamg/subdatamg/Videolist.vue'
    import Videopre from '@v/datamg/subdatamg/Videopre.vue'
  import Alldevice from '@v/devicemg/Alldevice.vue'
    import Alldevicelist from '@v/devicemg/suballdevice/Alldevicelist.vue'
    import Alldevicemap from '@v/devicemg/suballdevice/Alldevicemap.vue'
    import Alldevicepreview from '@v/devicemg/suballdevice/Alldevicepreview.vue'
    import Deviceset from '@v/devicemg/suballdevice/Deviceset.vue'
    import Devicesetdetail from '@v/devicemg/suballdevice/Deviceset.vue'
    import Devicedetail from '@v/devicemg/suballdevice/Devicedetail.vue'
  import Abnormaldevice from '@v/devicemg/Abnormaldevice.vue'
    import Abnormalmap from '@v/devicemg/subabnormal/Abnormalmap.vue'
    import Abnormallist from '@v/devicemg/subabnormal/Abnormallist.vue'
  import Deviceabnormal from '@v/devicemg/Deviceabnormal.vue'
  import Onlinedevice from '@v/devicemg/Onlinedevice.vue'
    import Onlinedevicelist from '@v/devicemg/subollinedevice/Onlinedevicelist.vue'
    import Onliedevicedetail from '@v/devicemg/subollinedevice/Onliedevicedetail.vue'
    import Onlinemap from '@v/devicemg/subollinedevice/Onlinemap.vue'
    import Onlinepreview from '@v/devicemg/subollinedevice/Onlinepreview.vue'
      import Ninemode from '@v/devicemg/subollinedevice/Ninemode.vue'
      import Fourmode from '@v/devicemg/subollinedevice/Fourmode.vue'
      import Onemode from '@v/devicemg/subollinedevice/Onemode.vue'
  import Modifypass from '@v/usermg/Modifypass.vue'
  import Userdevicegrant from '@v/usermg/Userdevicegrant.vue'
  import Usermg from '@v/usermg/Usermg.vue'
  import Payment from '@v/usermg/Payment.vue' 
    import Personaltailor from '@v/usermg/subpayment/Personaltailor.vue'
      import Personaorderdetail from '@v/usermg/subpayment/Personaorderdetail.vue'
      import Personapayorder from '@v/usermg/subpayment/Personapayorder.vue'
    import Rapidupgrade from '@v/usermg/subpayment/Rapidupgrade.vue'
      import Raporderdetail from '@v/usermg/subpayment/Raporderdetail.vue'
      import Raopayorder from '@v/usermg/subpayment/Raopayorder.vue'
  import Filedownload from '@v/sysmg/Filedownload.vue'
  import Firmwaremg from '@v/sysmg/Firmwaremg.vue'
  import Mailconfig from '@v/sysmg/Mailconfig.vue'
  import Storagebackup from '@v/sysmg/Storagebackup.vue'
  import Menumg from '@v/sysmg/systemconfig/Menumg.vue'
  import Rolemg from '@v/sysmg/systemconfig/Rolemg.vue'
  import Toolsmg from '@v/toolsmg/Toolsmg.vue'
  import Mailmg from '@v/toolsmg/Mailmg.vue'


Vue.use(Router)

export default new Router({
  //登录界面
  base:'/ai',
  routes: [
    {
      path: '/',
      name: 'Login0',
      component: Login,
      meta: {
        requireAuth: false // 添加该字段，表示进入这个路由是需要登录的
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {
        requireAuth: false
      }
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      meta: {
        requireAuth:false,
      },
      children: [
        {
          path: '/mydata',
          name: 'Mydata',
          component: Mydata,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/mydevice',
          name: 'Mydevice',
          component: Mydevice,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/problem',
          name: 'Problem',
          component: Problem,
          meta: {
            requireAuth: false,
          },
          children: [
            {
              path: '/notnotified',
              name: 'Notnotified',
              component: Notnotified,
              meta: {
                requireAuth: true,
              }
            },
            {
              path: '/notified',
              name: 'Notified',
              component: Notified,
              meta: {
                requireAuth: true,
              }
            }
          ]
        },
        {
          path: '/exceptionreport',
          name: 'Exceptionreport',
          component: Exceptionreport,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/picturepreview',
          name: 'Picturepreview',
          component: Picturepreview,
          meta: {
            requireAuth: false,
          },
          children: [
            {
              path: '/picturelist',
              name: 'Picturelist',
              component: Picturelist,
              meta: {
                requireAuth: true,
              }
            },
            {
              path: '/preview',
              name: 'Preview',
              component: Preview,
              meta: {
                requireAuth: true,
              }
            }
          ]
        },
        {
          path: '/runningreport',
          name: 'Runningreport',
          component: Runningreport,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/sysreport',
          name: 'Sysreport',
          component: Sysreport,
          meta: {
            requireAuth: true,
          },
          children: []
        }, {
          path: '/userreport',
          name: 'Userreport',
          component: Userreport,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/videopreview',
          name: 'Videopreview',
          component: Videopreview,
          meta: {
            requireAuth: false,
          },
          children: [
            {
              path: '/videolist',
              name: 'Videolist',
              component: Videolist,
              meta: {
                requireAuth: true,
              }
            },
            {
              path: '/videopre',
              name: 'Videopre',
              component: Videopre,
              meta: {
                requireAuth: true,
              }
            }
          ]
        },
        {
          path: '/alldevice',
          name: 'Alldevice',
          component: Alldevice,
          meta: {
            requireAuth: false,
          },
          children: [
            {
              path: '/alldevicelist',
              name: 'Alldevicelist',
              component: Alldevicelist,
              meta: {
                requireAuth: true
              },
              children: []
            },
            {
              path: '/alldevicemap',
              name: 'Alldevicemap',
              component: Alldevicemap,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path: '/alldevicepreview',
              name: 'Alldevicepreview',
              component: Alldevicepreview,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path:"/deviceset",
              name:"Deviceset",
              component:Deviceset,
              meta:{
                requireAuth:true,
              },
              children:[]
            },
            {
              path:'/devicesetdetail',
              name:"Devicesetdetail",
              component:Devicesetdetail,
              meta:{
                requireAuth:true,
              },
              children:[]
            },
            {
              path:'/devicedetail',
              name:"Devicedetail",
              component:Devicedetail,
              meta:{
                requireAuth:true,
              },
              children:[]
            }
          ]
        },
        {
          path: '/abnormaldevice',
          name: 'Abnormaldevice',
          component: Abnormaldevice,
          meta: {
            requireAuth: false,
          },
          children: [
            {
              path: '/abnormalmap',
              name: 'Abnormalmap',
              component: Abnormalmap,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path: '/abnormallist',
              name: 'Abnormallist',
              component: Abnormallist,
              meta: {
                requireAuth: true,
              },
              children: []
            }
          ]
        },
        {
          path: '/deviceabnormal',
          name: 'Deviceabnormal',
          component: Deviceabnormal,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/onlinedevice',
          name: 'Onlinedevice',
          component: Onlinedevice,
          meta: {
            requireAuth: false,
          },
          children: [
            {
              path: '/onlinedevicelist',
              name: 'Onlinedevicelist',
              component: Onlinedevicelist,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path: '/onlinemap',
              name: 'Onlinemap',
              component: Onlinemap,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path: '/onlinepreview',
              name: 'Onlinepreview',
              component: Onlinepreview,
              meta: {
                requireAuth: false,
              },
              children: [
                {
                  path: '/ninemode',
                  name: 'Ninemode',
                  component: Ninemode,
                  meta: {
                    requireAuth: true,
                  },
                  children: []
                },
                {
                  path: '/fourmode',
                  name: 'Fourmode',
                  component: Fourmode,
                  meta: {
                    requireAuth: true,
                  },
                  children: []
                },
                {
                  path: '/onemode',
                  name: 'Onemode',
                  component: Onemode,
                  meta: {
                    requireAuth: true,
                  },
                  children: []
                }
              ]
            }
          ], 
        },
        {
          path:'/onliedevicedetail',
          name:"Onliedevicedetail",
          component:Onliedevicedetail,
          meta:{
            requireAuth:true,
          },
          children:[]
        },
        {
          path: '/modifypass',
          name: 'Modifypass',
          component: Modifypass,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/payment',
          name: 'Payment',
          component: Payment,
          meta: {
            requireAuth: false,
          },
          children: [
            {
              path: '/personaltailor',
              name: 'Personaltailor',
              component: Personaltailor,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path: '/rapidupgrade',
              name: 'Rapidupgrade',
              component: Rapidupgrade,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path: '/raporderdetail',
              name: 'Raporderdetail',
              component: Raporderdetail,
              meta: {
                requireAuth: true,
              },
              children: []
            },
            {
              path:'/raopayorder',
              name:'Raopayorder',
              component:Raopayorder,
              meta:{
                requireAuth:true,
              },
              children:[],
            },
            {
              path:"/personaorderdetail",
              name:"Personaorderdetail",
              component:Personaorderdetail,
              meta:{
                 requireAuth:true,
              },
              children:[],
            },
            {
              path:"/personapayorder",
              name:"Personapayorder",
              component:Personapayorder,
              meta:{
                 requireAuth:true,
              },
              children:[],
            }
          ]
        },
        {
          path: '/userdevicegrant',
          name: 'Userdevicegrant',
          component: Userdevicegrant,
          meta: {
            requireAuth: true,
          },
          children: [],
        },
        {
          path: '/usermg',
          name: 'Usermg',
          component: Usermg,
          meta: {
            requireAuth: true
          },
          children: []
        },
        {
          path: '/filedownload',
          name: 'Filedownload',
          component: Filedownload,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/firmwaremg',
          name: 'Firmwaremg',
          component: Firmwaremg,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/mailconfig',
          name: 'Mailconfig',
          component: Mailconfig,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/storagebackup',
          name: 'Storagebackup',
          component: Storagebackup,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/menumg',
          name: 'Menumg',
          component: Menumg,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/rolemg',
          name: 'Rolemg',
          component: Rolemg,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/toolsmg',
          name: 'Toolsmg',
          component: Toolsmg,
          meta: {
            requireAuth: true,
          },
          children: []
        },
        {
          path: '/mailmg',
          name: 'Mailmg',
          component: Mailmg,
          meta: {
            requireAuth: true,
          },
          children: []
        }
      ],
    },
    {
      path: '/404',
      name: '404',
      component: Fault,
      meta: {
        requireAuth: false
      }
    },
    {
      path: '*',
      name: 'Fault',
      component: Fault,
      meta: {
        requireAuth: false
      }
    }
  ]
})
